import Vue from "vue";
import VueRouter from "vue-router";
// import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",

    component: () => import(/* webpackChunkName: "about" */ "../views/layout"),
    redirect: "/",
    children: [
      {
        path: "/",

        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/index.vue")
      },
      {
        path: "/my",
        name: "my",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/my/index.vue")
      },
      {
        path: "/qa",
        name: "qa",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/qa/index.vue")
      },
      {
        path: "/video",
        name: "video",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/video/index.vue")
      }
    ]
  },
  {
    path: "/login",

    component: () =>
      import(/* webpackChunkName: "about" */ "../views/login/index.vue")
  },
  {
    path: "/profile",

    component: () =>
      import(/* webpackChunkName: "about" */ "../views/user/profile.vue")
  },
  {
    path: "/search",
    name: "search",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/home/search/index.vue")
  },
  {
    path: "/article/:articleId",
    name: "article",
    component: () =>
      import(
        /* webpackChunkName: "about" */ "../views/home/article/article.vue"
      ),
    props: true
  }
];

const router = new VueRouter({
  routes
});

export default router;
